<template>
	<view class="address">
		<button class="diamond-button" @click="gotoAddressMange">地址管理页</button>
		<button class="diamond-button" @click="gotoPickerAddress">选一个地址</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		methods: {
			gotoAddressMange() {
				uni.navigateTo({
					url: "/pages/content/addressManage/addressManage"
				})
			},
			gotoPickerAddress() {
				uni.navigateTo({
					url: "/pages/content/addressManage/addressManage?type=picker",
					events: {
						pickerAddress: (event) => {
							// 这里获取picker到的地址
							console.log('---- 选到的地址是 ----: ', event.data)
						}
					}
				})
			}
		}
	}
</script>

<style>
	.address {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		height: 400rpx;
		margin-top:120rpx ;
		/* Adjust the height as needed */
	}

	.diamond-button {
		width: 320rpx;
		height: 320rpx;
		margin: 10rpx;
		clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: #e8872f;
		color: white;
		border: none;
		cursor: pointer;
	}

	
	.address .diamond-button:last-child {
		transform: translateY(50rpx);
	}
</style>